package com.frank.big.web;

import com.frank.big.ApiClient;
import com.frank.big.model.BidataRequest;
import com.frank.big.service.EnterpriseInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


/**
 * @author 小石潭记
 * @date 2020/10/23 10:19
 * @Description: ${todo}
 */
@RestController
@RequestMapping("/bidata")
public class BidataOnlineController {

    @Autowired
    private EnterpriseInfoService service;

    /**
     * @param id 010fff23665d13b277d31291ba56c5ff
     * @return
     */
    @GetMapping("/index")
    public Object index(BidataRequest bidataRequest) {
        return service.getEnterpriseInfo(bidataRequest);
    }

    @GetMapping("/info")
    public Object info(String id) {
        String data = ApiClient.callGet(
                "7W03RFHF",
                "T1YAEGbDOz7tIzq5cxff91jqG4PBtB75dY7IKcfqNS8ev0jYSJwtU4RSyqhQO8b9",
                "entinfo?id=" + id,
                false
        );
        return data;
    }

}
